(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
filter(cons(X, Y), 0, M) → cons(0, filter(Y, M, M))
filter(cons(X, Y), s(N), M) → cons(X, filter(Y, N, M))
sieve(cons(0, Y)) → cons(0, sieve(Y))
sieve(cons(s(N), Y)) → cons(s(N), sieve(filter(Y, N, N)))
nats(N) → cons(N, nats(s(N)))
zprimes → sieve(nats(s(s(0))))
Rewrite Strategy: FULL
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
filter(cons(X, Y), 0', M) → cons(0', filter(Y, M, M))
filter(cons(X, Y), s(N), M) → cons(X, filter(Y, N, M))
sieve(cons(0', Y)) → cons(0', sieve(Y))
sieve(cons(s(N), Y)) → cons(s(N), sieve(filter(Y, N, N)))
nats(N) → cons(N, nats(s(N)))
zprimes → sieve(nats(s(s(0'))))
S is empty.
Rewrite Strategy: FULL
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
TRS:
Rules:
filter(cons(X, Y), 0', M) → cons(0', filter(Y, M, M))
filter(cons(X, Y), s(N), M) → cons(X, filter(Y, N, M))
sieve(cons(0', Y)) → cons(0', sieve(Y))
sieve(cons(s(N), Y)) → cons(s(N), sieve(filter(Y, N, N)))
nats(N) → cons(N, nats(s(N)))
zprimes → sieve(nats(s(s(0'))))
Types:
filter :: cons → 0':s → 0':s → cons
cons :: 0':s → cons → cons
0' :: 0':s
s :: 0':s → 0':s
sieve :: cons → cons
nats :: 0':s → cons
zprimes :: cons
hole_cons1_0 :: cons
hole_0':s2_0 :: 0':s
gen_cons3_0 :: Nat → cons
gen_0':s4_0 :: Nat → 0':s
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
filter,
sieve,
natsThey will be analysed ascendingly in the following order:
filter < sieve
(6) Obligation:
TRS:
Rules:
filter(
cons(
X,
Y),
0',
M) →
cons(
0',
filter(
Y,
M,
M))
filter(
cons(
X,
Y),
s(
N),
M) →
cons(
X,
filter(
Y,
N,
M))
sieve(
cons(
0',
Y)) →
cons(
0',
sieve(
Y))
sieve(
cons(
s(
N),
Y)) →
cons(
s(
N),
sieve(
filter(
Y,
N,
N)))
nats(
N) →
cons(
N,
nats(
s(
N)))
zprimes →
sieve(
nats(
s(
s(
0'))))
Types:
filter :: cons → 0':s → 0':s → cons
cons :: 0':s → cons → cons
0' :: 0':s
s :: 0':s → 0':s
sieve :: cons → cons
nats :: 0':s → cons
zprimes :: cons
hole_cons1_0 :: cons
hole_0':s2_0 :: 0':s
gen_cons3_0 :: Nat → cons
gen_0':s4_0 :: Nat → 0':s
Generator Equations:
gen_cons3_0(0) ⇔ hole_cons1_0
gen_cons3_0(+(x, 1)) ⇔ cons(0', gen_cons3_0(x))
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
The following defined symbols remain to be analysed:
filter, sieve, nats
They will be analysed ascendingly in the following order:
filter < sieve
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
filter(
gen_cons3_0(
+(
1,
n6_0)),
gen_0':s4_0(
0),
gen_0':s4_0(
0)) →
*5_0, rt ∈ Ω(n6
0)
Induction Base:
filter(gen_cons3_0(+(1, 0)), gen_0':s4_0(0), gen_0':s4_0(0))
Induction Step:
filter(gen_cons3_0(+(1, +(n6_0, 1))), gen_0':s4_0(0), gen_0':s4_0(0)) →RΩ(1)
cons(0', filter(gen_cons3_0(+(1, n6_0)), gen_0':s4_0(0), gen_0':s4_0(0))) →IH
cons(0', *5_0)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
TRS:
Rules:
filter(
cons(
X,
Y),
0',
M) →
cons(
0',
filter(
Y,
M,
M))
filter(
cons(
X,
Y),
s(
N),
M) →
cons(
X,
filter(
Y,
N,
M))
sieve(
cons(
0',
Y)) →
cons(
0',
sieve(
Y))
sieve(
cons(
s(
N),
Y)) →
cons(
s(
N),
sieve(
filter(
Y,
N,
N)))
nats(
N) →
cons(
N,
nats(
s(
N)))
zprimes →
sieve(
nats(
s(
s(
0'))))
Types:
filter :: cons → 0':s → 0':s → cons
cons :: 0':s → cons → cons
0' :: 0':s
s :: 0':s → 0':s
sieve :: cons → cons
nats :: 0':s → cons
zprimes :: cons
hole_cons1_0 :: cons
hole_0':s2_0 :: 0':s
gen_cons3_0 :: Nat → cons
gen_0':s4_0 :: Nat → 0':s
Lemmas:
filter(gen_cons3_0(+(1, n6_0)), gen_0':s4_0(0), gen_0':s4_0(0)) → *5_0, rt ∈ Ω(n60)
Generator Equations:
gen_cons3_0(0) ⇔ hole_cons1_0
gen_cons3_0(+(x, 1)) ⇔ cons(0', gen_cons3_0(x))
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
The following defined symbols remain to be analysed:
sieve, nats
(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
sieve(
gen_cons3_0(
+(
1,
n2748_0))) →
*5_0, rt ∈ Ω(n2748
0)
Induction Base:
sieve(gen_cons3_0(+(1, 0)))
Induction Step:
sieve(gen_cons3_0(+(1, +(n2748_0, 1)))) →RΩ(1)
cons(0', sieve(gen_cons3_0(+(1, n2748_0)))) →IH
cons(0', *5_0)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(11) Complex Obligation (BEST)
(12) Obligation:
TRS:
Rules:
filter(
cons(
X,
Y),
0',
M) →
cons(
0',
filter(
Y,
M,
M))
filter(
cons(
X,
Y),
s(
N),
M) →
cons(
X,
filter(
Y,
N,
M))
sieve(
cons(
0',
Y)) →
cons(
0',
sieve(
Y))
sieve(
cons(
s(
N),
Y)) →
cons(
s(
N),
sieve(
filter(
Y,
N,
N)))
nats(
N) →
cons(
N,
nats(
s(
N)))
zprimes →
sieve(
nats(
s(
s(
0'))))
Types:
filter :: cons → 0':s → 0':s → cons
cons :: 0':s → cons → cons
0' :: 0':s
s :: 0':s → 0':s
sieve :: cons → cons
nats :: 0':s → cons
zprimes :: cons
hole_cons1_0 :: cons
hole_0':s2_0 :: 0':s
gen_cons3_0 :: Nat → cons
gen_0':s4_0 :: Nat → 0':s
Lemmas:
filter(gen_cons3_0(+(1, n6_0)), gen_0':s4_0(0), gen_0':s4_0(0)) → *5_0, rt ∈ Ω(n60)
sieve(gen_cons3_0(+(1, n2748_0))) → *5_0, rt ∈ Ω(n27480)
Generator Equations:
gen_cons3_0(0) ⇔ hole_cons1_0
gen_cons3_0(+(x, 1)) ⇔ cons(0', gen_cons3_0(x))
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
The following defined symbols remain to be analysed:
nats
(13) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol nats.
(14) Obligation:
TRS:
Rules:
filter(
cons(
X,
Y),
0',
M) →
cons(
0',
filter(
Y,
M,
M))
filter(
cons(
X,
Y),
s(
N),
M) →
cons(
X,
filter(
Y,
N,
M))
sieve(
cons(
0',
Y)) →
cons(
0',
sieve(
Y))
sieve(
cons(
s(
N),
Y)) →
cons(
s(
N),
sieve(
filter(
Y,
N,
N)))
nats(
N) →
cons(
N,
nats(
s(
N)))
zprimes →
sieve(
nats(
s(
s(
0'))))
Types:
filter :: cons → 0':s → 0':s → cons
cons :: 0':s → cons → cons
0' :: 0':s
s :: 0':s → 0':s
sieve :: cons → cons
nats :: 0':s → cons
zprimes :: cons
hole_cons1_0 :: cons
hole_0':s2_0 :: 0':s
gen_cons3_0 :: Nat → cons
gen_0':s4_0 :: Nat → 0':s
Lemmas:
filter(gen_cons3_0(+(1, n6_0)), gen_0':s4_0(0), gen_0':s4_0(0)) → *5_0, rt ∈ Ω(n60)
sieve(gen_cons3_0(+(1, n2748_0))) → *5_0, rt ∈ Ω(n27480)
Generator Equations:
gen_cons3_0(0) ⇔ hole_cons1_0
gen_cons3_0(+(x, 1)) ⇔ cons(0', gen_cons3_0(x))
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
No more defined symbols left to analyse.
(15) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
filter(gen_cons3_0(+(1, n6_0)), gen_0':s4_0(0), gen_0':s4_0(0)) → *5_0, rt ∈ Ω(n60)
(16) BOUNDS(n^1, INF)
(17) Obligation:
TRS:
Rules:
filter(
cons(
X,
Y),
0',
M) →
cons(
0',
filter(
Y,
M,
M))
filter(
cons(
X,
Y),
s(
N),
M) →
cons(
X,
filter(
Y,
N,
M))
sieve(
cons(
0',
Y)) →
cons(
0',
sieve(
Y))
sieve(
cons(
s(
N),
Y)) →
cons(
s(
N),
sieve(
filter(
Y,
N,
N)))
nats(
N) →
cons(
N,
nats(
s(
N)))
zprimes →
sieve(
nats(
s(
s(
0'))))
Types:
filter :: cons → 0':s → 0':s → cons
cons :: 0':s → cons → cons
0' :: 0':s
s :: 0':s → 0':s
sieve :: cons → cons
nats :: 0':s → cons
zprimes :: cons
hole_cons1_0 :: cons
hole_0':s2_0 :: 0':s
gen_cons3_0 :: Nat → cons
gen_0':s4_0 :: Nat → 0':s
Lemmas:
filter(gen_cons3_0(+(1, n6_0)), gen_0':s4_0(0), gen_0':s4_0(0)) → *5_0, rt ∈ Ω(n60)
sieve(gen_cons3_0(+(1, n2748_0))) → *5_0, rt ∈ Ω(n27480)
Generator Equations:
gen_cons3_0(0) ⇔ hole_cons1_0
gen_cons3_0(+(x, 1)) ⇔ cons(0', gen_cons3_0(x))
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
No more defined symbols left to analyse.
(18) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
filter(gen_cons3_0(+(1, n6_0)), gen_0':s4_0(0), gen_0':s4_0(0)) → *5_0, rt ∈ Ω(n60)
(19) BOUNDS(n^1, INF)
(20) Obligation:
TRS:
Rules:
filter(
cons(
X,
Y),
0',
M) →
cons(
0',
filter(
Y,
M,
M))
filter(
cons(
X,
Y),
s(
N),
M) →
cons(
X,
filter(
Y,
N,
M))
sieve(
cons(
0',
Y)) →
cons(
0',
sieve(
Y))
sieve(
cons(
s(
N),
Y)) →
cons(
s(
N),
sieve(
filter(
Y,
N,
N)))
nats(
N) →
cons(
N,
nats(
s(
N)))
zprimes →
sieve(
nats(
s(
s(
0'))))
Types:
filter :: cons → 0':s → 0':s → cons
cons :: 0':s → cons → cons
0' :: 0':s
s :: 0':s → 0':s
sieve :: cons → cons
nats :: 0':s → cons
zprimes :: cons
hole_cons1_0 :: cons
hole_0':s2_0 :: 0':s
gen_cons3_0 :: Nat → cons
gen_0':s4_0 :: Nat → 0':s
Lemmas:
filter(gen_cons3_0(+(1, n6_0)), gen_0':s4_0(0), gen_0':s4_0(0)) → *5_0, rt ∈ Ω(n60)
Generator Equations:
gen_cons3_0(0) ⇔ hole_cons1_0
gen_cons3_0(+(x, 1)) ⇔ cons(0', gen_cons3_0(x))
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
filter(gen_cons3_0(+(1, n6_0)), gen_0':s4_0(0), gen_0':s4_0(0)) → *5_0, rt ∈ Ω(n60)
(22) BOUNDS(n^1, INF)